package com.example;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.boot.SpringApplication;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.time.LocalDate;

public class MybatisPlusApplication {

    @Data
    @EqualsAndHashCode(callSuper = false)
    @Accessors(chain = true)
    @TableName("wl_traffic_monitor")
    public static class TrafficMonitor implements Serializable {
        private static final long serialVersionUID = 1L;
        @TableId(value = "id", type = IdType.AUTO)
        private Integer id;
        private String deviceCode;
        private LocalDate trafficDay;
        private Integer upCount;
        private Integer downCount;
        private Integer upFlow;
        private Integer downFlow;
    }

    @Mapper
    public interface TrafficMonitorMapper extends BaseMapper<TrafficMonitor> {

    }

    public interface TrafficMonitorService extends IService<TrafficMonitor> {

    }

    @Service
    public static class TrafficMonitorImpl extends ServiceImpl<TrafficMonitorMapper, TrafficMonitor> implements TrafficMonitorService {

    }

    public static void main(String[] args) {
        SpringApplication.run(MybatisPlusApplication.class, args);
    }


}
